﻿using Commons.ReturnData;
using OpenAI.Domain.Entities;
using System.Linq.Expressions;

namespace OpenAI.Domain.IRepositories
{
    public interface IChatSessionRepository
    {
        /// <summary>
        /// 获取用户聊天列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="expressions"></param>
        /// <returns></returns>
        Task<DataResult<ChatSession>> GetChatSessionsByUserIdAsync(int pageIndex, int pageSize, Expression<Func<ChatSession, bool>> expressions);
        Task<DataResult<ChatSession>> GetChatSessionsByUserIdAsync(Guid appUserId);
        /// <summary>
        /// 用户创建一条聊天
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="title"></param>
        /// <returns></returns>
        Task<MessageResult> CreateChatSessionAsync(Guid userId,string title);
        /// <summary>
        /// 更改聊天标题
        /// </summary>
        /// <param name="chatSession"></param>
        /// <returns></returns>
        Task<MessageResult> UpdateChatSessionAsync(ChatSession chatSession);
        /// <summary>
        /// 删除聊天
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<MessageResult> DeletedChatSessionAsync(int id);
        /// <summary>
        /// 查找某一条聊天
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>

        Task<ChatSession> GetChatSessionsByIdAsync(int id);
    }
}
